load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain")
load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain")
load(":defs.bzl", "python_toolchain")

oncall("build_infra")

system_cxx_toolchain(
    name = "cxx",
    visibility = ["PUBLIC"],
)

system_genrule_toolchain(
    name = "genrule",
    visibility = ["PUBLIC"],
)

system_python_bootstrap_toolchain(
    name = "python_bootstrap",
    interpreter = "python3",
    visibility = ["PUBLIC"],
)

remote_file(
    name = "python-download",
    out = "cpython.tar.gz",
    sha256 = "445156c61e1cc167f7b8777ad08cc36e5598e12cd27e07453f6e6dc0f62e421e",
    url = "https://github.com/indygreg/python-build-standalone/releases/download/20241002/cpython-3.13.0rc3+20241002-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz",
)

extract_archive(
    name = "python-extract",
    src = ":python-download",
)

python_toolchain(
    name = "python",
    distribution = ":python-extract",
    visibility = ["PUBLIC"],
)
